﻿
using Storm.TextEditor.Editor.Text;

namespace Storm.TextEditor.Editor.Undo
{
    /// <summary>
    /// Represents a class that holds information on undo/redo actions.
    /// </summary>
    public sealed class UndoBlock
    {
        #region Fields

        private string text = "";
        private string replacedText = "";

        private TextPoint position = new TextPoint(0, 0);
        private UndoAction action = 0;

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the Text of the UndoBlock.
        /// </summary>
        public string Text
        {
            get { return text; }
            set { text = value; }
        }

        /// <summary>
        /// Gets or sets the ReplacedText of the UndoBlock.
        /// </summary>
        public string ReplacedText
        {
            get { return replacedText; }
            set { replacedText = value; }
        }

        /// <summary>
        /// Gets or sets the Position of the UndoBlock.
        /// </summary>
        public TextPoint Position
        {
            get { return position; }
            set { position = value; }
        }

        /// <summary>
        /// Gets or sets the Action of the UndoBlock.
        /// </summary>
        public UndoAction Action
        {
            get { return action; }
            set { action = value; }
        }

        #endregion

        /// <summary>
        /// Initializes a new instance of UndoBlock.
        /// </summary>
        public UndoBlock()
        {
        }
    }
}
